package com.kaifamiao.N0726;

import java.util.Random;

public class Trees {
    public static void main(String[] args) {
        Tree ess = new Tree();

        Random r = new Random();
        for(int i = 0 ;i <= 10;i++){
            int n = r.nextInt(3);
            if(n == 0){
                ess.water();
            }
            if(n == 1){
                ess.insecticide();
            }
            if(n ==2){
                ess.parasite();
            }
        }
        if(ess.health <=0){
            System.out.println("树的健康值太低，树死了。");
        }else{
            System.out.println("树没死，健康值为"+ess.health);
        }

        }

    }
